package org.ucas.faker.web.fetcher.meta;

import org.ucas.faker.web.fetcher.FetchRequest;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class ValueSet implements Serializable {

  public List<ConstantField> values;

  public FetchRequest sub;

  public String sql() {
    if(values != null) return "(" + values.stream().map(ConstantField::sql)
        .collect(Collectors.joining(",")) + ")";

    return "(" + sub.sql() + ")";
  }

}
